<template>
  <el-input v-model="input.phone" style="width: 240px" placeholder="phone" />
  <el-input
    v-model="input.password"
    style="width: 240px"
    type="password"
    placeholder="Please input password"
    show-password
  />
  <!-- href="/login" -->
  <el-button
    type="primary"
    tag="登录"
    target="_blank"
    rel="noopener noreferrer"
    @click="onSubmit"
  >
    登录
  </el-button>
  <el-button
    type="primary"
    tag="注册"
    target="_blank"
    rel="noopener noreferrer"
    href="/registered"
    @click="onSubmit"
  >
    注册
  </el-button>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'
import { login } from '@/api/login'
const input = reactive({
  phone: '',
  password: '',
})
const onSubmit = (input: RegisterParams) => {
  login(input).then(res => {
    console.log(res.data)
  })
}
</script>

<style scoped></style>
